<?php

// No direct access
defined('_JEXEC') or die('Restricted access');
if ($this->item->published==0) return;
$filename = 'components/com_shop/images/originals/'.$this->item->main_img;
$size = getimagesize ('components/com_shop/images/originals/'.$this->item->main_img);
?>
<div class="breabcrumbs">

<a href="index.php?option=com_shop&view=category&id=<?php echo $this->item->cat_id;?>"><?php echo $this->category->name;?></a><?php if($item->articul_wo_char>0){?> > Модель <?php echo $this->item->articul_wo_char;}?>
</div>
<div class="componentheader"><?php echo htmlspecialchars($this->item->name);?></div>
<table cellpadding=0 cellspacing=0 class="item_table">
	<tr>
		<td>
			<div style="position:relative;float:left;">
			<?php if(file_exists(JPATH_SITE."/components/com_shop/images/big/".$this->item->main_img)):?>
			<table cellpadding=0 cellspacing=0>
				<tr>
					<td class="frame_center_left">
					
					</td>
					<td class="frame_center" align="center">
						<div class="image_div">
							<div class="corner_left_top"></div>
							<div class="corner_right_top"></div>
							<div class="corner_right_bottom"></div>
							<div class="corner_left_bottom"></div>
							<a href="#" onclick="w=window.open('/components/com_shop/images/originals/<?php echo $this->item->main_img;?>','','width=<?php echo $size[0]?>,height=<?php echo $size[1]?>');w.setTitle='<?php echo htmlspecialchars($this->item->name);?>';return false;" href="" style="font-size: 0px;">
								<img   src="components/com_shop/images/big/<?php echo $this->item->main_img;?>" alt="<?php echo $this->item->name?>"/>
							</a>
						</div>
						<div class="" style="position:relative;clear:both;"><a style="color:#3a3a3a;font-size:11px;" href="#" onclick="w=window.open('/components/com_shop/images/originals/<?php echo $this->item->main_img;?>','','width=<?php echo $size[0]?>,height=<?php echo $size[1]?>');w.setTitle='<?php echo htmlspecialchars($this->item->name);?>';return false;">увеличить>></a></div>
					</td>
					<td class="frame_cente_right" rowspan=2 valign=bottom>
						<div class="bottom_frame_right"></div>
					</td>
				</tr>
				<tr>
					<td colspan=2 class="bottom_frame">
						<div class="frame_left">
						</div>
						
						<div class="frame_right">
						</div>
					</td>
					
				</tr>
			</table>
			<?php endif;?>
			</div>
		</td>
		<td class="item_info" valign="top">
			<div class="item_description">
				<?php echo $this->item->description;?>
			</div>
			<div class="top_shape">&nbsp;</div>
			<div class="center_shape">
				<table cellpadding=0 cellspacing=0>
					<tr>
						<td>
							Цена:<br/>
						</td>
						<td>
							<span style="color:#7e0101;"><?php echo $this->item->price;?>.00 РУБ</span>
						</td>
					</tr>
					<?php if($this->item->old_price != 0){ ?>
					<tr>
						<td>Старая цена: </td>
						<td><span style="text-decoration:line-through;"><?php echo $this->item->old_price.'.00 руб.';?></span></td>					
					</tr>
					<?php }?>
					<tr valign="top">
						<?php if(count($this->types)>0):?>
						<td style="padding-right:10px;">
							Цвет/размер:
						</td>
						<td>
							<table style="width:275px;" cellpadding=0 cellspacing=0>				
							<?php 
								
								foreach($this->types as $type){
									echo '<tr><td valign="top" style="width:125px;"><span>'.$type->value.'</span></td>';
									echo '<td valign="top" style="padding-left:5px;">
											<div class="add_to_basket">
												<a href="index.php?option=com_shop&task=addToBasket&id='.$this->item->articul.'&type='.urlencode($type->value).'">добавить в корзину</a>
											</div>
										 </td>';
									echo '</tr>';
								}
							
							?>
							</table>
						</td>
						<?php else:?>
						<td colspan=2>
							К сожалению, позиция отсутствует в текущих каталогах компании.
						</td>						
						<?php endif;?>
					</tr>
				</table>
			</div>
			<div class="bottom_shape">&nbsp;</div>
			<ul class="add_information">
				<?php 
					if($this->item->material != '') echo '<li>Материал: '.$this->item->material.'</li>';
					if($this->item->manufact != '') echo '<li>Производитель: '.$this->item->manufact.'</li>';
					
					
				?>
			</ul>
			<div style="float:left;position:relative;width:100%;font-size:12px;" class="keywords">
<?php if(count($this->keywords)>0){ echo 'Этот товар также принадлежит к следующим категориям: <ul class="add_information">'; foreach($this->keywords as $keyword) echo '<li><a href="'.JRoute::_('index.php?option=com_shop&view=tags&id='.$keyword->id).'">'.$keyword->name.'</a></li>'; echo '</ul>';}?>
</div>
		</td>
	
	</tr>
	<tr>
		<td colspan=2 style="margin-top:10px;"> 
			<?php 
				$add_images = explode(';',$this->item->add_img);
				if(count($add_images) > 0)
					foreach($add_images as $add_image){	
						if($add_image != '')
						if(file_exists(JPATH_SITE."/components/com_shop/images/big/".$add_image)):
							$size = getimagesize ('components/com_shop/images/originals/'.$add_image);	
			?>
			<div style="position:relative;float:left;">
					<table cellpadding=0 cellspacing=0 style="margin-bottom:10px;">
					<tr>
						<td class="frame_center_left">
						
						</td>
						<td class="frame_center" align="center">
							<div class="image_div">
								<div class="corner_left_top"></div>
								<div class="corner_right_top"></div>
								<div class="corner_right_bottom"></div>
								<div class="corner_left_bottom"></div>
								<a href="#" onclick="w=window.open('/components/com_shop/images/originals/<?php echo $add_image;?>','','width=<?php echo $size[0]?>,height=<?php echo $size[1]?>');w.setTitle='<?php echo htmlspecialchars($this->item->name);?>';return false;" href="" style="font-size: 0px;">
									<img   src="components/com_shop/images/big/<?php echo $add_image;?>" alt="<?php echo $this->item->name?>"/>
								</a>
							</div>
							<div class="" style="position:relative;clear:both;"><a style="color:#3a3a3a;font-size:11px;" href="#" onclick="w=window.open('/components/com_shop/images/originals/<?php echo $add_image;?>','','width=<?php echo $size[0]?>,height=<?php echo $size[1]?>');w.setTitle='<?php echo htmlspecialchars($this->item->name);?>';return false;">увеличить>></a></div>
						</td>
						<td class="frame_cente_right" rowspan=2 valign=bottom>
							<div class="bottom_frame_right"></div>
						</td>
					</tr>
					<tr>
						<td colspan=2 class="bottom_frame">
							<div class="frame_left">
							</div>
							
							<div class="frame_right">
							</div>
						</td>
						
					</tr>
				</table>	
			</div>	
					
					
			<?php 
					endif;		
				}			
			?>
		</td>
	</tr>
</table>
<div class="cat_description">
<?php
echo $this->item->additional_text;?>
</div>



